#pragma once
#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>
#include<assert.h>

typedef int BTData;

typedef struct BinaryTreeNode
{
	BTData data;
	struct BinaryTreeNode* left;
	struct BinaryTreeNode* right;
}BTNode;

void PreOrder(BTNode* BT);

void InOrder(BTNode* BT);

void PostOrder(BTNode* BT);

BTNode* BuyBTNode(BTData x);

void Destroy(BTNode* node);

int BTSize(BTNode* root);

int BinaryTreeLeafSize(BTNode* root);

//K层节点个数
int BinaryTreeLeafKSize(BTNode* root, int k);

//二叉树深度
int BinaryTreeDepth(BTNode* root);

//二叉树查找值为X的节点
BTNode* BinaryTreeFind(BTNode* root, BTData x);

//层序遍历
void BinaryTreeLevelOrder(BTNode* root);

//判断是否为完全二叉树
bool BinaryTreeComplete(BTNode* root);

//销毁二叉树
void BinaryTreeDestroy(BTNode* root);